<%@ page contentType="text/html;charset=UTF-8" trimDirectiveWhitespaces="true"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<c:set var="extLibs" value="validate,fileupload"/>
<sys:header title="互助会申请管理 - ${fraternity.isNewRecord ? '新增' : '编辑'}互助会申请" extLibs="${extLibs}"/>
<link href="${ctxStatic}/common/css/form.css" rel="stylesheet" type="text/css">

<div class="portlet box ${boxStyleColor} autoHeight">
	<div class="portlet-body form">
		<form:form id="inputForm" modelAttribute="fraternity" action="${ctx}/mih/fraternity/save" method="post" class="form-horizontal">

			<div class="tool">
				<input id="btnSubmit1" type="button" value="通过" class="tool1">
				<input id="btnSubmit2" type="button" value="退回" class="tool2">
				<input id="btnCancel" type="button" value="关闭" class="tool1" onclick="closeCurrentTabPage('${param.parentTabPageId}')">
			</div>
			<div class="biaodan_bg">
				<div class="biaodan">
					<table width="100%" border="0" class="tb2">
						<tr>
							<td colspan="8" align="center"  ><strong style="font-size:24px; font-weight:normal;">${fns:getConfig('university')}教职工参加补充医疗保险互助会申请表</strong></td>
						</tr>
					</table>
						<table width="100%" border="0" class="tb4">

							<form:hidden path="id"/>
							<form:hidden path="approveStatus"/>

							<tr>
								<td  width="100" class="text-center" bgcolor="#f5f5f5">姓名</td>
								<td width="120">
									<form:hidden path="memberCode"/>
									<form:input path="memberName" htmlEscape="false" maxlength="64" class="form-control required"/>
								</td>
								<td  width="100" class="text-center" bgcolor="#f5f5f5">性别</td>
								<td width="120">
									<form:select path="sex" multiple="false" class="form-control required input-sm"  >
										<form:options items="${fns:getDictList('sex')}" itemLabel="name" itemValue="value" htmlEscape="false"/>
									</form:select>
								</td>
								<td width="120" rowspan="3">
									<sys:fileupload id="file" bizCategory="mih_fraternity" bizKey="${fraternity.id}" 
										 uploadType="image" maxUploadNum="1" isMini="true" imageStyle="width:100px;height:120px;"/>
								</td>
							</tr>
							<tr>
								<td  width="100" class="text-center" bgcolor="#f5f5f5">参加工作时间</td>
								<td width="120">
									<input name="workDate" type="text" readonly="readonly" maxlength="20" class="form-control Wdate required"
											value="<fmt:formatDate value="${fraternity.workDate}" pattern="yyyy-MM-dd"/>"
											onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
								</td>
								<td  width="100" class="text-center" bgcolor="#f5f5f5">退休时间</td>
								<td width="120">
									<input name="retireDate" type="text" readonly="readonly" maxlength="20" class="form-control Wdate required"
											value="<fmt:formatDate value="${fraternity.retireDate}" pattern="yyyy-MM-dd"/>"
											onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
								</td>
								
							</tr>
							<tr>
								<td  width="100" class="text-center" bgcolor="#f5f5f5">身份证号码</td>
								<td width="120" colspan="3">
									<form:input path="idNo" htmlEscape="false" maxlength="64" class="form-control required"/>
								</td>
							</tr>
							<tr>
								<td  width="100" class="text-center" bgcolor="#f5f5f5">单   位</td>
								<td width="120" colspan="2">
									<sys:treeselect id="officeCode" name="officeCode" value="${fraternity.officeCode}" labelName="officeName" labelValue="${fraternity.officeName}" 
							 			title="单位" url="/sys/office/treeData?isAll=true" cssClass="required"  allowClear="true"/>
								</td>
								<td  width="100" class="text-center" bgcolor="#f5f5f5">工作证号</td>
								<td width="120">
									<form:input path="workNo" htmlEscape="false" maxlength="64" class="form-control required"/>
								</td>
							</tr>
							<tr>
								<td  width="100" class="text-center" bgcolor="#f5f5f5">家庭住址</td>
								<td width="120" colspan="2">
									<form:input path="address" htmlEscape="false" maxlength="64" class="form-control required"/>
								</td>
								<td  width="100" class="text-center" bgcolor="#f5f5f5">联系电话</td>
								<td width="120">
									<form:input path="phone" htmlEscape="false" maxlength="64" class="form-control required"/>
								</td>
							</tr>
							<tr>
								<td class="text-center" bgcolor="#f5f5f5">分工会审批意见</td>
								<td colspan="5">
									<form:textarea path="officeApproveMemo" htmlEscape="false" rows="8" maxlength="200" class="form-control  input-sm"/>
								</td>
							</tr>
							<tr>
								<td class="text-center" bgcolor="#f5f5f5">校工会审批意见</td>
								<td colspan="5">
									<form:textarea path="committeeApproveMemo" htmlEscape="false" rows="8" maxlength="200" class="form-control  input-sm"/>
								</td>
							</tr>
						</table>
				</div>
			</div>


		</form:form>
	</div>
</div>
<sys:footer extLibs="${extLibs}"/>
<script type="text/javascript">
	$("#inputForm").validate({
		submitHandler: function(form){
			ajaxSubmitForm($(form), function(data){
				showMessage(data.message);
				if(data.result == Global.TRUE){
					closeCurrentTabPage('${param.parentTabPageId}', function(contents, contentWindow){
						contentWindow.page();
					});
				}
			}, "json");
	    }
	});
	$('#btnSubmit1').click(function(){
		$("#approveStatus").val("4");
		$("#inputForm").submit();
	});
	$('#btnSubmit2').click(function(){
		$("#approveStatus").val("5");
		$("#inputForm").submit();
	});

</script>